<?php

namespace app\common\model;



use app\extra\BaseModel;

class Category extends BaseModel
{
    /**
     * 添加额外参数
     * @param $item
     */
    public function setAddedField(&$item){
        // $item['public_desc'] = \app\extra\DBCont::getPublishStatus($item['publish']);
        $item['category_num'] = model('subject')->where('category_id', $item['id'])->count();
        $item['major_num'] = model('major')->where('category_id', $item['id'])->count();
    }
}
